tableInserts is package{
  -- test out ading elements to a relation

  R has type ref relation of ((string,integer));
  var R := relation of {
    ("a",1);
  };
  
  check has type (string,relation of ((string,integer))) =>boolean;
  check(S,Rl) is ((SS,_) where SS=S) in Rl;
  
  main has type action();
  main() do {
    assert not ("b",2) in R;
    extend R with ("b",2);
    assert ("b",2) in R;
    logMsg(info,"is a in $R? $(check("a",R))");
    logMsg(info,"is e in $R? $(check("e",R))");
    
    merge R with relation{("e",5)};
    logMsg(info,"is e in $R? $(check("e",R))");
    assert ("e",5) in R;
    
    merge R with relation{("aa",1);("bb",2);("cc",3)};
    logMsg(info,"is cc in $R? $(check("cc",R))");
    assert ("aa",_) in R;
    
    RR has type ref relation of ((string,integer));
    var RR := relation of {};
    for KV in (all (K,V) where (K,V) in R and V>1) do
      extend RR with KV;
    logMsg(info,"RR=$RR");
  }
}